<?php

class CachePlugin extends Zend_Cache {
	
	public static function init($type = 'Core', $lifetime = 7200) {
			$frontendOptions = array(
				'lifetime' => $lifetime,
				'automatic_serialization' => true
			);
			$backendOptions = array(
				'cache_dir' => APPLICATION_PATH . '/../cache/',
				'hashed_directory_level' => 1,
				'hashed_directory_umask' => 0777,
				'cache_file_umask' => 0777
			);
		return Zend_Cache::factory($type, 'File', $frontendOptions, $backendOptions);;
	}
}